package ex1;

import ex1.Count;
import ex1.CountWithBug;
import junit.framework.TestCase;

public class PrimePathsCoverage extends EdgeCoverageCases {
	
	/*
	 * Prime Paths:
	 * 
	 * Length 0:		Length 1:		Length 2:		Length 3: 		Length 4: 		Length 5:
	 * 1				12				123				1234			12345			123457*	(Infeasable)
	 * 2				23				127!			2345			12346			623457!
	 * 3				27!				234				2346			23452*
	 * 4				34				345				3452			23457!
	 * 5				45				346				3462			23462*
	 * 6				46				452				4523			34527!
	 * 7!				52				457!			4527!			34523*
	 * 					57!				462				4627!			34523*
	 * 					62				627!			4623			34623*
	 * 									623				6234			34627!
	 * 																	45234*
	 * 																	46234*
	 *																	62345
	 *																	62346*
	 *
	 *
	 * The longest infeasible path is infeasible since it's impossible to move through 5->7 on the 1st run, since it checks that i>0.
	 * We can use T1 and using Detour [1,2,3,4,5->[2,3,4,5,2,3,4,5]->7] for testing it.
	 * 
	 * There for - Lets start from the longest one:  [6,2,3,4,5,7!] (Covered in T1)
	 * We'll find shorter ones that doesn't contained in the previous path: 
	 * [2,3,4,5,2*] (Covered in T2)
	 * [2,3,4,6,2*] (Covered in T1)
	 * [3,4,5,2,7!] <- T4
	 * [3,4,6,2,7!] <- T5
	 * [1,2,7!] (Covered in T2)
	 * [4,5,7!] (Covered in T1)
	 */		
	

	public void test4() {
		int result = Count.count(new int[]{1});
		assertEquals(result, 1);
	}

	
	public void test5() {
		int result = Count.count(new int[]{-1});
		assertEquals(result, 0);
	}
	

	public void test4withBug() {
		int result = CountWithBug.count(new int[]{1});
		assertEquals(result, 1);
	}


	public void test5withBug() {
		int result = CountWithBug.count(new int[]{-1});
		assertEquals(result, 0);
	}
	
			
}
